1. Field
This application relates to a method and apparatus for calculating data.
2. Description of Related Art
A central processing unit (CPU) or a graphics processing unit (GPU) may perform a calculation of data represented using a floating point method by substituting a number corresponding to the data into a mathematical function.
In this case, the CPU or the GPU may perform a calculation using a look-up table storing information needed for calculating all pieces of data that may be input. However, the look-up table needs to store many pieces of information in order to provide accurate calculation results, and thus an enormous storage space is required.
The CPU or the GPU may also perform a calculation by approximating a mathematical function by a polynomial. However, since a high-order polynomial is needed to obtain accurate calculation results, excessive switching between logic gates may occur during the calculation.
The CPU or the GPU may process a plurality of pieces of data at one time in response to a single command. In this case, the plurality of pieces of data to be processed may be integrated together. In other words, the pieces of data that are processed at one time may be localized within a predetermined section. Therefore, when the CPU or the GPU sequentially processes (i.e., calculates) pieces of data localized within a predetermined section, a method of reducing the amount of data stored in the look-up table and the number of times switching between logic gates occurs during a calculation is needed.